/**
 * Created by tingyanwu on 17/2/21.
 */


$(function()
{
    lastId=getCookie("lastId");
   $("#"+lastId).show();


    currentId=getCookie("currentId");
    $("#mc"+currentId).addClass("currentMenu");





});


function c(id) {
    setCookie("lastId",id);
}

function c2(id) {
    setCookie("currentId",id);
}





//操作菜单，让菜单自动展开上次点击的
function setCookie(name,value) {
    document.cookie = name + '=' + escape(value);
}

function getCookie(name)
{
    var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"); //正则匹配
    if(arr=document.cookie.match(reg)){
        return unescape(arr[2]);
    }
    else{
        return null;
    }
}


